package me.firstapp.service.shop;

import java.util.Date;
import java.util.List;
import java.util.Map;

import me.firstapp.common.utils.Page;
import me.firstapp.module.shop.Product;

public interface ProductService {

	/**
	 * 分页查询商品
	 * 
	 * @param pageNo
	 * @param pageSize
	 * @param categoryId
	 * @param disable
	 * @param apiClientId
	 * @return
	 */
	Page<Product> findProductPage(Integer pageNo, Integer pageSize, Long categoryId, Integer disable, Long apiClientId);

	/**
	 * 通过id查询商品
	 * 
	 * @param productId
	 * @param apiClientId
	 * @return
	 */
	Product findProductById(Long productId, Long apiClientId);

	/**
	 * 分页查询商品
	 * 
	 * @param pageNo
	 * @param pageSize
	 * @param searchParams
	 * @param sortParam
	 * @param sortType
	 * @param startTime
	 * @param endTime
	 * @param apiClientId
	 * @return
	 */
	Page<Product> findProductPageByParams(Integer pageNo, Integer pageSize, Map<String, Object> searchParams,
			String sortParam, String sortType, Date startTime, Date endTime, Long apiClientId);

	/**
	 * 商品新增
	 * 
	 * @param categoryId
	 * @param listImage
	 * @param smallImage
	 * @param imges
	 * @param name
	 * @param summary
	 * @param detail
	 * @param deliver
	 * @param deliverFee
	 * @param sort
	 * @param apiClientId
	 * @return
	 */
	Product addProduct(Long categoryId, String listImage, String smallImage, String imges, String name, String summary,
			String detail, String deliver, Double deliverFee, Integer sort, Long apiClientId);

	/**
	 * 商品更新
	 * 
	 * @param productId
	 * @param categoryId
	 * @param listImage
	 * @param smallImage
	 * @param imges
	 * @param name
	 * @param summary
	 * @param detail
	 * @param deliver
	 * @param deliverFee
	 * @param sort
	 * @param disable
	 * @param apiClientId
	 * @return
	 */
	Product updateProduct(Long productId, Long categoryId, String listImage, String smallImage, String imges,
			String name, String summary, String detail, String deliver, Double deliverFee, Integer sort,
			Integer disable, Long apiClientId);

	/**
	 * 删除
	 * 
	 * @param ids
	 *            多个id时用","隔开
	 */
	void deleteProducts(String ids, Long apiClientId);

	/**
	 * 获取商品列表
	 * 
	 * @param disable
	 * @param apiClientId
	 * @return
	 */
	List<Product> findProducts(Integer disable, Long apiClientId);
}
